libmymath.so:Add.o Sub.o
	g++ -shared -o $@ $^

Add.o Sub.o:Add.cc Sub.cc
	g++ -fPIC -c -o $@ $^

.PHONY:output
output:
	mkdir mylib
	mkdir -p mylib/include
	mkdir -p mylib/lib
	mv *.so mylib/lib
	mv *.h mylib/include


# libmymath.a:Add.o Sub.o
# 	ar -rc $@ $^
# Add.o:Add.cc
# 	g++ -c -o $@ $^ -std=c++11
# Sub.o:Sub.cc
# 	g++ -c -o $@ $^ -std=c++11

# .PHONY:output
# output:
# 	mkdir mylib
# 	mkdir -p mylib/include
# 	mkdir -p mylib/lib
# 	mv *.a mylib/lib
# 	mv *.h mylib/include

.PHONY:clean
clean:
	rm -rf mylib